-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Validator] Add option to allow ANY protocol in Assert\Url constraint #21398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e6eed1a
to
49cb38b
Compare
|
||
// allows all protocols whose names are RFC 3986 compliant | ||
// (e.g. 'https://', 'git+ssh://', 'file://', 'custom://') | ||
protocols: ['*'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should allow '*'
(so a string without the need to wrap it in an array)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #21406
protocols: ['*'] | ||
|
||
// regular expressions are also valid | ||
protocols: ['https?', 'custom.*', 'my-app-.*'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we backport this to older branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow you. Is this available in older branches? I thought it was a new feature added in 7.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe then this actually doesn't work at all? Because the only change I see in symfony/symfony#60561 is a strict comparison with ['*']
. The remaining behaviour of the validator didn't change.
…` option (xabbuh) This PR was merged into the 7.4 branch. Discussion ---------- [Validator] rework the usage of `'*'` for the `protocols` option following #21398, related to symfony/symfony#61826 Commits ------- 83a9025 rework the usage of '*' for the protocols option
Fixes #21397.